package com.apobates.jforum.grief.aurl.executor;

import java.util.Collection;
import java.util.Objects;

/**
 * RawMetaClipParameterExecutor的操作历史
 * @param action 动作
 * @param param 参数名称
 * @param values 参数列集合
 */
public record AUrlMetaActionRecord(String action, String param, Collection<String> values) {
    @Override
    public String toString(){
        return String.format("{action:%s, param:%s, values:%s}", this.action, this.param, String.join(",", values));
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AUrlMetaActionRecord that = (AUrlMetaActionRecord) o;
        return action.equals(that.action) && param.equals(that.param);
    }

    @Override
    public int hashCode() {
        return Objects.hash(action, param);
    }
}
